package com.ljf.test.job;

import com.ljf.framework.job.LjfJob;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import java.util.concurrent.TimeUnit;


@Component
public class SampleLjfJob {
    private static Logger logger = LoggerFactory.getLogger(SampleLjfJob.class);


    /**
     * 1、简单任务示例（Bean模式）
     */
    @LjfJob("demoJobHandler")
    public void demoJobHandler() throws Exception {
        logger.info("LJF-JOB, Hello World.");

        for (int i = 0; i < 5; i++) {
            logger.info("beat at:" + i);
            TimeUnit.SECONDS.sleep(2);
        }
    }


}
